package exceptiondates;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/***
 * Process the exception dates adding and formating and the return of the array list of the exception dates.
 */
public abstract class ExceptionDates {
	protected SimpleDateFormat df;
	protected ArrayList<Date> dates = new ArrayList<>();
	
	/***
	 * Return the array list of the exception dates.
	 * @return	the array list of the exception dates
	 */
	public ArrayList<Date> getList(){
		return dates;
	}
	
	/***
	 * Template method to let exception dates of different universities to implement.
	 * @throws ParseException	If an exception occurred
	 */
	protected abstract void addDates() throws ParseException;

	/***
	 * Class constructor.
	 */
	public ExceptionDates(){
		 df = new SimpleDateFormat("MM dd yyyy", Locale.ENGLISH);
		 df.setTimeZone(TimeZone.getTimeZone("Asia/Hong_Kong"));
		 try{
			 addDates();
		 }catch(ParseException e){}
	}
}
